﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WordsGame
{
    internal class TreeNode
    {
        public const char FakeLeafe = '\0';

        public Nullable<char> Value { get; set; }

        public Dictionary<char, TreeNode> Descendants { get; set; }

        public static TreeNode FakeNode()
        {
            return new TreeNode(FakeLeafe);
        }

        public TreeNode()
        {
            Init(null);
        }

        public TreeNode(char initValue)
        {
            Init(initValue);
        }

        private void Init(Nullable<char> value)
        {
            Value = value;
            Descendants = new Dictionary<char, TreeNode>();
        }
    }
}
